home *** CD-ROM | disk | FTP | other *** search
/ 3D Games (Spidla) / 3dhry2.iso / Cube Drop 2001 1.0 / src / Canvas.h < prev    next >
Encoding:
C/C++ Source or Header  |  2003-03-17  |  1.6 KB  |  64 lines

  1. #ifdef WIN32
  2. #include "windows.h"
  3. #endif
  4.  
  5. #ifndef CANVAS_H
  6. #define CANVAS_H
  7.  
  8. #include <GL/gl.h>
  9. #include <GL/glu.h>
  10. #include <GL/glut.h>
  11. #include <GL/glaux.h>
  12. #include <math.h>
  13. #include <stdio.h>
  14. #include <string.h>
  15. #include <stdlib.h>
  16.  
  17. #define DISPLAY_LIST_SIZE 10
  18. #define TRUE 1
  19. #define FALSE 0
  20. #define YES 1
  21. #define NO 0
  22.  
  23. typedef struct DISPLAY_LIST_STRUCT
  24. {
  25.     char name[40];
  26.     GLint id;
  27.     GLint available;
  28. } DISPLAY_LIST_TYPE;
  29.  
  30. class Canvas{
  31. public:
  32.     GLint miWidth;
  33.     GLint miHeight;
  34.     GLint m_CurrDegree;
  35.  
  36.     DISPLAY_LIST_TYPE display_list[DISPLAY_LIST_SIZE];
  37.         
  38.     Canvas(GLint x, GLint y, GLint width, GLint height, char *windowTitle);
  39.     ~Canvas();
  40.     void setPerspectiveWindow(GLdouble fovy, GLdouble aspect,GLdouble zNear,GLdouble zFar);
  41.     void setWindow(GLfloat fLeft, GLfloat fRight, GLfloat fBottom, GLfloat fTop);
  42.     void setViewport(GLint iX, GLint iY, GLsizei iWidth, GLsizei iHeight);
  43.     void setBackgroundColor(GLfloat red, GLfloat green, GLfloat blue);
  44.     void setLighting();
  45.     void setBlending();
  46.     void setDepthBuffer();
  47.     void setDiffuseMaterialColor(GLfloat red, GLfloat green, GLfloat blue,GLfloat alpha);
  48.     void setAmbientMaterialColor(GLfloat red, GLfloat green, GLfloat blue,GLfloat alpha);
  49.     void setMaterialShininess(GLint intensity);
  50.     void setSpecularMaterialColor(GLfloat red, GLfloat green, GLfloat blue,GLfloat alpha);
  51.     void Box(int, int, int);
  52.     GLint ReserveDisplayListId(char *name);
  53.     GLint FindDisplayListId(char *name);
  54.     void buildGrid(char *Name);
  55. private:
  56.     GLint cubeSize;
  57.     GLfloat gameWidth;
  58.     GLfloat gameDepth;
  59.     GLfloat gameHeight;
  60. };
  61.  
  62.  
  63.  
  64. #endif